/**
 * Created by asus on 2017/5/4.
 */
    //消息列表
    $(function(){
        var ms_content = $(".ms_content");
        var unread_icon = $(".mes_left_icon i");
        var param = {
            data:{
                star:localStorage.u_type,
                page:1
            },
            url:'Messages/center'
        };
        if(param.data.star!=100){
            param.data.star = 0;
        }
        $.JsonRpc(param,function(obj){
            var data = obj.data;
            var ms_title =$(".ms_title");
            if(data.bulletin){
                if(data.bulletin.list.length>0){
                    ms_content.eq(0).html(data.bulletin.list[0].b_title);
                    unread_icon.eq(0).addClass("ic_cir");
                }
            }
            if(data.obtain){
                if(data.obtain.list.length>0){
                    if(data.obtain.list[0].o_type==10){
                        ms_content.eq(1).html(data.obtain.list[0].s_name+"送了你一个"+data.obtain.list[0].g_sponsor+"L币的红包");
                    }else if(data.obtain.list[0].o_type==20){
                        ms_content.eq(1).html(data.obtain.list[0].s_name+"送了你一个"+data.obtain.list[0].g_name);
                    }
                    unread_icon.eq(1).addClass("ic_cir");
                }
            }
            if(data.private){
                if(data.private.list.length>0){
                    ms_content.eq(2).html(data.private.list[0].m_title);
                    unread_icon.eq(2).addClass("ic_cir");
                }
            }
            if(data.leave){
                if(data.leave.list.length>0){
                    ms_content.eq(3).html(data.leave.list[0].c_content);
                    unread_icon.eq(3).addClass("ic_cir");
                }
            }
            if(data.comment){
                if(data.comment.list.length>0){
                    ms_content.eq(4).html(data.comment.list[0].u_nickname+"回复了我");
                    unread_icon.eq(4).addClass("ic_cir");
                }
            }
            //data.bulletin.list[0].b_title
        });

      /*  //评论列表
        var req = {
            url:'Circles/comList',
            data:{}
        };

        $.JsonRpc(req,function(obj){
            var data = obj.data;
            console.log(data);
            if(data.num>0){
                ms_content.eq(1).html(data.list[0].u_nickname+"回复了你");
            }
        });*/



    });



